﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace FindArtInfo
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "AdvancedSearch",
                url: "advanced-search.html",
                defaults: new { controller = "Home", action = "AdvancedSearch", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "MonogramSearch",
                url: "monogram-search.html",
                defaults: new { controller = "Monogram", action = "Search", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "BrowseByArtist1",
                url: "browse-by-artist.html",
                defaults: new { controller = "Artists", action = "Letter", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "BrowseByArtist2",
                url: "{letter}/browse-by-artist.html",
                defaults: new { controller = "Artists", action = "Letter", letter = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "BrowseByArtist3",
                url: "browse-by-artist/page/{pageIndex}.html",
                defaults: new { controller = "Artists", action = "Letter", pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "BrowseByArtist4",
                url: "{letter}/browse-by-artist/page/{pageIndex}.html",
                defaults: new { controller = "Artists", action = "Letter", letter = UrlParameter.Optional, pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "BrowseSignatures1",
                url: "browse-signatures.html",
                defaults: new { controller = "Signatures", action = "Letter", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "BrowseSignatures2",
                url: "{letter}/browse-signatures.html",
                defaults: new { controller = "Signatures", action = "Letter", letter = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "BrowseSignatures3",
                url: "browse-signatures/page/{pageIndex}.html",
                defaults: new { controller = "Signatures", action = "Letter", pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "BrowseSignatures4",
                url: "{letter}/browse-signatures/page/{pageIndex}.html",
                defaults: new { controller = "Signatures", action = "Letter", letter = UrlParameter.Optional, pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "ArtPictures1",
                url: "art-pictures.html",
                defaults: new { controller = "Artists", action = "ListPictures", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "ArtPictures2",
                url: "{itemSelected}/{sort}/art-pictures/page/{pageIndex}.html",
                defaults: new { controller = "Artists", action = "ListPictures", itemSelected = UrlParameter.Optional, sort = UrlParameter.Optional, pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "ArtPictures4",
                url: "art-pictures/{itemSelected}/{itemTypeId}/{sort}/{itemTypeName}/page/{pageIndex}.html",
                defaults: new { controller = "Artists", action = "ListPictures", itemSelected = UrlParameter.Optional, itemTypeId = UrlParameter.Optional, sort = UrlParameter.Optional, pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "ArtPictures3",
                url: "art-pictures/{itemSelected}/{itemTypeId}/{sort}/{itemTypeName}.html",
                defaults: new { controller = "Artists", action = "ListPictures", itemSelected = UrlParameter.Optional, itemTypeId = UrlParameter.Optional, sort = UrlParameter.Optional, id = UrlParameter.Optional }
            );
            
            routes.MapRoute(
                name: "ArtistSignatures1",
                url: "artist-signatures.html",
                defaults: new { controller = "Signatures", action = "ListPictures", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "ArtistSignatures2",
                url: "{itemSelected}/{sort}/artist-signatures/page/{pageIndex}.html",
                defaults: new { controller = "Signatures", action = "ListPictures", itemSelected = UrlParameter.Optional, sort = UrlParameter.Optional }
            );            
            routes.MapRoute(
                name: "ArtLinks",
                url: "art-links.html",
                defaults: new { controller = "ArtLinks", action = "Search", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "ArtistLink",
                url: "artist-link/{artistsId}/{artistsName}.html",
                defaults: new { controller = "ArtistLink", action = "Index", artistsId = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "SubmitYourSite",
                url: "submit-your-site.html",
                defaults: new { controller = "SubmitYourSite", action = "Index", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "FAQ",
                url: "faq.html",
                defaults: new { controller = "FAQ", action = "Index", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "Register",
                url: "register.html",
                defaults: new { controller = "Account", action = "Register", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "RegisterPartner",
                url: "{partnerCode}/register.html",
                defaults: new { controller = "Account", action = "Register", partnerCode = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "ForgotPassword",
                url: "forgot-password.html",
                defaults: new { controller = "Account", action = "ForgotPassword", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "ChangePassWord",
                url: "change-password.html",
                defaults: new { controller = "Account", action = "ChangePassWord", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "AccountInfo",
                url: "account-info.html",
                defaults: new { controller = "Account", action = "Detail", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LoginReNew",
                url: "login-renew.html",
                defaults: new { controller = "Account", action = "LoginPaid", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "Login",
                url: "login.html",
                defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "ReNew",
                url: "renew.html",
                defaults: new { controller = "Account", action = "ReNew", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "RegisterAgain",
                url: "register-again.html",
                defaults: new { controller = "Account", action = "RegisterAgain", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "ListPriceByArtist1",
                url: "list-prices-by-artist/{artistsId}/{artistsName}.html",
                defaults: new { controller = "Prices", action = "ListPrices", artistsId = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "ListPriceByArtist2",
                url: "list-prices-by-artist/{artistsId}/{artistsName}/page/{pageIndex}.html",
                defaults: new { controller = "Prices", action = "ListPrices", artistsId = UrlParameter.Optional, pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "ListPriceByArtist3",
                url: "list-prices-by-artist/{order}/{artistsId}/{artistsName}/page/{pageIndex}.html",
                defaults: new { controller = "Prices", action = "ListPrices", artistsId = UrlParameter.Optional, pageIndex = UrlParameter.Optional, order = UrlParameter.Optional}
            );

            routes.MapRoute(
                name: "ListPriceHasArtWorkByArtist1",
                url: "list-prices-has-art-work-by-artist/{artistsId}/{artistsName}.html",
                defaults: new { controller = "Prices", action = "ListPricesHasArtWork", artistsId = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "ListPriceHasArtWorkByArtist2",
                url: "list-prices-has-art-work-by-artist/{artistsId}/{artistsName}/page/{pageIndex}.html",
                defaults: new { controller = "Prices", action = "ListPricesHasArtWork", artistsId = UrlParameter.Optional, pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "ListPriceHasArtWorkByArtist3",
                url: "list-prices-has-art-work-by-artist/{order}/{artistsId}/{artistsName}/page/{pageIndex}.html",
                defaults: new { controller = "Prices", action = "ListPricesHasArtWork", artistsId = UrlParameter.Optional, pageIndex = UrlParameter.Optional, order = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "PriceDetail",
                url: "price-info/{priceId}/{priceName}.html",
                defaults: new { controller = "Prices", action = "Detail", priceId = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "ListSignaturesByArtist",
                url: "list-signatures-by-artist/{artistsId}/{artistsName}.html",
                defaults: new { controller = "Signatures", action = "ListSignatures", artistsId = UrlParameter.Optional}
            );
            routes.MapRoute(
                name: "MailFriend",
                url: "mail-friend.html",
                defaults: new { controller = "MailFriend", action = "Index", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "TermsConditions",
                url: "terms-conditions.html",
                defaults: new { controller = "TermsConditions", action = "Index", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "Home",
                url: "home.html",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LogOut",
                url: "logout.html",
                defaults: new { controller = "Account", action = "LogOut", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "Members",
                url: "members/{k}",
                defaults: new { controller = "Account", action = "Members", k = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "English",
                url: "english.html",
                defaults: new { controller = "Home", action = "English", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "German",
                url: "german.html",
                defaults: new { controller = "Home", action = "German", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "French",
                url: "french.html",
                defaults: new { controller = "Home", action = "French", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "Language",
                url: "{l}/language.html",
                defaults: new { controller = "Home", action = "Language", l = UrlParameter.Optional }
            );
            //language
            routes.MapRoute(
                name: "LanguageAdvancedSearch",
                url: "{language}/advanced-search.html",
                defaults: new { controller = "Home", action = "AdvancedSearch", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageMonogramSearch",
                url: "{language}/monogram-search.html",
                defaults: new { controller = "Monogram", action = "Search", id = UrlParameter.Optional }
            );
            //routes.MapRoute(
            //    name: "LanguageBrowseByArtist1",
            //    url: "{language}/browse-by-artist.html",
            //    defaults: new { controller = "Artists", action = "Letter", id = UrlParameter.Optional }
            //);
            routes.MapRoute(
                name: "LanguageBrowseByArtist2",
                url: "{language}/{letter}/browse-by-artist.html",
                defaults: new { controller = "Artists", action = "Letter", letter = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageBrowseByArtist3",
                url: "{language}/browse-by-artist/page/{pageIndex}.html",
                defaults: new { controller = "Artists", action = "Letter", pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageBrowseByArtist4",
                url: "{language}/{letter}/browse-by-artist/page/{pageIndex}.html",
                defaults: new { controller = "Artists", action = "Letter", letter = UrlParameter.Optional, pageIndex = UrlParameter.Optional }
            );
            //routes.MapRoute(
            //    name: "LanguageBrowseSignatures1",
            //    url: "{language}/browse-signatures.html",
            //    defaults: new { controller = "Signatures", action = "Letter", id = UrlParameter.Optional }
            //);
            routes.MapRoute(
                name: "LanguageBrowseSignatures2",
                url: "{language}/{letter}/browse-signatures.html",
                defaults: new { controller = "Signatures", action = "Letter", letter = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageBrowseSignatures3",
                url: "{language}/browse-signatures/page/{pageIndex}.html",
                defaults: new { controller = "Signatures", action = "Letter", pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageBrowseSignatures4",
                url: "{language}/{letter}/browse-signatures/page/{pageIndex}.html",
                defaults: new { controller = "Signatures", action = "Letter", letter = UrlParameter.Optional, pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageArtPictures1",
                url: "{language}/art-pictures.html",
                defaults: new { controller = "Artists", action = "ListPictures", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageArtPictures2",
                url: "{language}/{itemSelected}/{sort}/art-pictures/page/{pageIndex}.html",
                defaults: new { controller = "Artists", action = "ListPictures", itemSelected = UrlParameter.Optional, sort = UrlParameter.Optional, pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageArtPictures4",
                url: "{language}/art-pictures/{itemSelected}/{itemTypeId}/{sort}/{itemTypeName}/page/{pageIndex}.html",
                defaults: new { controller = "Artists", action = "ListPictures", itemSelected = UrlParameter.Optional, itemTypeId = UrlParameter.Optional, sort = UrlParameter.Optional, pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageArtPictures3",
                url: "{language}/art-pictures/{itemSelected}/{itemTypeId}/{sort}/{itemTypeName}.html",
                defaults: new { controller = "Artists", action = "ListPictures", itemSelected = UrlParameter.Optional, itemTypeId = UrlParameter.Optional, sort = UrlParameter.Optional, id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "LanguageArtistSignatures1",
                url: "{language}/artist-signatures.html",
                defaults: new { controller = "Signatures", action = "ListPictures", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageArtistSignatures2",
                url: "{language}/{itemSelected}/{sort}/artist-signatures/page/{pageIndex}.html",
                defaults: new { controller = "Signatures", action = "ListPictures", itemSelected = UrlParameter.Optional, sort = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageArtLinks",
                url: "{language}/art-links.html",
                defaults: new { controller = "ArtLinks", action = "Search", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageArtistLink",
                url: "{language}/artist-link/{artistsId}/{artistsName}.html",
                defaults: new { controller = "ArtistLink", action = "Index", artistsId = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageSubmitYourSite",
                url: "{language}/submit-your-site.html",
                defaults: new { controller = "SubmitYourSite", action = "Index", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageFAQ",
                url: "{language}/faq.html",
                defaults: new { controller = "FAQ", action = "Index", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageRegister",
                url: "{language}/register.html",
                defaults: new { controller = "Account", action = "Register", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageRegisterPartner",
                url: "{language}/{partnerCode}/register.html",
                defaults: new { controller = "Account", action = "Register", partnerCode = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageForgotPassword",
                url: "{language}/forgot-password.html",
                defaults: new { controller = "Account", action = "ForgotPassword", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageChangePassWord",
                url: "{language}/change-password.html",
                defaults: new { controller = "Account", action = "ChangePassWord", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageAccountInfo",
                url: "{language}/account-info.html",
                defaults: new { controller = "Account", action = "Detail", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageLoginReNew",
                url: "{language}/login-renew.html",
                defaults: new { controller = "Account", action = "LoginPaid", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageLogin",
                url: "{language}/login.html",
                defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageReNew",
                url: "{language}/renew.html",
                defaults: new { controller = "Account", action = "ReNew", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageRegisterAgain",
                url: "{language}/register-again.html",
                defaults: new { controller = "Account", action = "RegisterAgain", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageListPriceByArtist1",
                url: "{language}/list-prices-by-artist/{artistsId}/{artistsName}.html",
                defaults: new { controller = "Prices", action = "ListPrices", artistsId = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageListPriceByArtist2",
                url: "{language}/list-prices-by-artist/{artistsId}/{artistsName}/page/{pageIndex}.html",
                defaults: new { controller = "Prices", action = "ListPrices", artistsId = UrlParameter.Optional, pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageListPriceByArtist3",
                url: "{language}/list-prices-by-artist/{order}/{artistsId}/{artistsName}/page/{pageIndex}.html",
                defaults: new { controller = "Prices", action = "ListPrices", artistsId = UrlParameter.Optional, pageIndex = UrlParameter.Optional, order = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "LanguageListPriceHasArtWorkByArtist1",
                url: "{language}/list-prices-has-art-work-by-artist/{artistsId}/{artistsName}.html",
                defaults: new { controller = "Prices", action = "ListPricesHasArtWork", artistsId = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageListPriceHasArtWorkByArtist2",
                url: "{language}/list-prices-has-art-work-by-artist/{artistsId}/{artistsName}/page/{pageIndex}.html",
                defaults: new { controller = "Prices", action = "ListPricesHasArtWork", artistsId = UrlParameter.Optional, pageIndex = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageListPriceHasArtWorkByArtist3",
                url: "{language}/list-prices-has-art-work-by-artist/{order}/{artistsId}/{artistsName}/page/{pageIndex}.html",
                defaults: new { controller = "Prices", action = "ListPricesHasArtWork", artistsId = UrlParameter.Optional, pageIndex = UrlParameter.Optional, order = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "LanguagePriceDetail",
                url: "{language}/price-info/{priceId}/{priceName}.html",
                defaults: new { controller = "Prices", action = "Detail", priceId = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageListSignaturesByArtist",
                url: "{language}/list-signatures-by-artist/{artistsId}/{artistsName}.html",
                defaults: new { controller = "Signatures", action = "ListSignatures", artistsId = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageMailFriend",
                url: "{language}/mail-friend.html",
                defaults: new { controller = "MailFriend", action = "Index", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageTermsConditions",
                url: "{language}/terms-conditions.html",
                defaults: new { controller = "TermsConditions", action = "Index", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageHome",
                url: "{language}/home.html",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageLogOut",
                url: "{language}/logout.html",
                defaults: new { controller = "Account", action = "LogOut", id = UrlParameter.Optional }
            );            
            routes.MapRoute(
                name: "LanguageArtistsSearchResult",
                url: "{language}/Artists/Result",
                defaults: new { controller = "Artists", action = "Result", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageMonogramSearchResult",
                url: "{language}/Monogram/Result",
                defaults: new { controller = "Monogram", action = "Result", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguageArtLinksSearchResult",
                url: "{language}/ArtLinks/Result",
                defaults: new { controller = "ArtLinks", action = "Result", id = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "LanguagePriceSearchResult",
                url: "{language}/Prices/Result",
                defaults: new { controller = "Prices", action = "Result", id = UrlParameter.Optional }
            );
            //end
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}